<template>
    <el-input placeholder="请输入内容" v-model="value" class="input-with-select">
        <el-select class="search-select" v-model="type" slot="prepend" placeholder="请选择">
            <el-option label="姓名" value="name"></el-option>
            <el-option label="性别" value="gender"></el-option>
            <el-option label="年龄" value="age"></el-option>
        </el-select>
        <el-button slot="append" icon="el-icon-search" @click="handleSearch"></el-button>
    </el-input>
</template>
<script>
export default {
    data() {
        return {
            type: "name",
            value: ""
        }
    },
    methods: {
        handleSearch() {
            this.$emit('show', { type: this.type, value: this.value });
        }
    }
}
</script>
<style>
.search-select{
    width: 120px;
}
</style>